Previous | Index | Next |

Stream iterators

To make it possible for the generic algorithms to work directly with input/output streams, appropriate iterator-like classes are provided. For example,
     Algo.partial_sum_copy(
	new InputStreamIterator(System.cin, new FuncTextReader(FuncBase.Double)),
        new InputStreamIterator(),
        new OutputStreamIterator(System.out,new FuncTextWriter(), "\n"));
reads a file containing floating point numbers from System.in, and prints the partial sums onto System.out.


Previous | Index | Next |